package com.jobpass.common.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jobpass.common.insterface.EnterpriseMapper;
import com.jobpass.common.model.Enterprise;
import com.jobpass.common.service.EnterpriseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author JobPass
 * @since 2020-07-17
 */
@Service
public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterprise> implements EnterpriseService {
    @Resource
    private EnterpriseMapper enterpriseMapper;

    @Override
    public List<Enterprise> findAllEnterprise() {
        return enterpriseMapper.selectList(null);
    }

    @Override
    public Enterprise findEnterpriseById(Long id) {
        return enterpriseMapper.selectById(id);
    }

    @Override
    public int deleteEnterpriseById(Long id) {
        return enterpriseMapper.deleteById(id);
    }

    @Override
    public int updateEnterpriseById(Enterprise enterprise) {
        return enterpriseMapper.updateById(enterprise);
    }

    @Override
    public int savaEnterprise(Enterprise enterprise) {
        return enterpriseMapper.insert(enterprise);
    }

    @Override
    public Enterprise queryUserByName(String username) {
       return enterpriseMapper.queryUserByName(username);
    }

    @Override
    public Enterprise findRolesByUserName(String username) {
        return enterpriseMapper.findRolesByUserName(username);
    }
}
